'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;


  /**
   * 主页
   */
  router.get('/', controller.home.recommend);//推荐
  router.get('/fullService', controller.home.fullService);//全案
  router.get('/plan', controller.home.plan);//个案
  router.get('/project', controller.home.project);//专题
  router.get('/research', controller.home.research);//调研
  router.get('/registered', controller.home.registered);//问答
  router.get('/article', controller.home.article);//文章

  /**
   * 分类
   */
  router.get('/classify', controller.classification.classify);//分类


  /**
   * 上传
   */
  router.post('/information', controller.upload.information);//资讯
  router.post('/resources', controller.upload.resources);//资源
  router.post('/design', controller.upload.design);//设计
  router.post('/postDemand', controller.upload.postDemand);//发布需求
  router.post('/askSolution', controller.upload.askSolution);//提问求解



  /**
   * 用户
   */

  /** 个人中心 */
  router.get('/personalCenter', controller.user.personalCenter);//个人资料
  router.get('/uInforResour', controller.user.uInforResour);//资讯&资源
  router.get('/plan', controller.user.plan);//方案
  router.get('/accessRecords', controller.user.accessRecords);//访问记录
  router.get('/attention', controller.user.attention);//关注
  router.post('/addLeaveWord', controller.user.addLeaveWord);//留言

  /** 消息中心 */
  router.get('/user/privateLetter', controller.messageCenter.privateLetter);//私信
  router.get('/user/notice', controller.messageCenter.notice);//通知
  router.get('/user/announcement', controller.messageCenter.announcement);//公告
  router.get('/user/dynamic', controller.messageCenter.dynamic);//动态
  router.get('/user/comments', controller.messageCenter.comments);//评论
  router.get('/user/messageBoard', controller.messageCenter.messageBoard);//留言板
  router.get('/user/giveALike', controller.messageCenter.giveALike);//点赞

  /** 我的收藏 */
  router.get('/user/inforResour', controller.collection.inforResour);//资讯&资源
  router.get('/user/plan', controller.collection.plan);//方案

  /** 我的关注 */
  router.get('/user/myFans', controller.user.myFans);//我的粉丝
  router.get('/user/myAttention', controller.user.myAttention);//我的关注

  /** 已购 */
  router.get('/user/purchasePlan', controller.user.purchasePlan);//已购的方案
  router.get('/user/purchaseWorks', controller.user.purchaseWorks);//已购的作品
  router.get('/user/exceptional', controller.user.exceptional);//打赏

 /** 我的 */
 router.get('/user/myWork', controller.user.myWork);//我的作品
 router.get('/user/myPlan', controller.user.myPlan);//我的方案
 router.get('/user/myNeeds', controller.user.myNeeds);//我的需求
 router.get('/user/myQuestions', controller.user.myQuestions);//我的提问
 router.get('/user/myAnswer', controller.user.myAnswer);//我的回答
};
